package com.runchen.broadcastdetection.mvp.login;

import com.ruochen.common.base.BaseView;
import com.ruochen.common.entity.UserInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 登录 MVP Covenant
 * @Auth RuoChen
 * @Date 04/04/2021, 14:20
 **/
public interface LoginCovenant {

    interface MvpView extends BaseView {
        void onLoginSuccess(UserInfo userInfo);
        void onLoginFailure(int code, String msg);

        String getAccountText();
        String getPasswordText();
        String getCaptchaText();
        String getUUIDText();
        void generateCode();
    }

    interface MvpStores {
        @FormUrlEncoded
        @POST("/sys/login")
        Observable<UserInfo> login(
                @Field("username") String username,
                @Field("password") String password,
                @Field("captcha") String captcha,
                @Field("uuid") String uuid);

    }

    interface Presenter {
        void login();

    }

}